CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
PROJECT(LGLog)

#1.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

#2. 
set(CMAKE_BUILD_TYPE "Release")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    message(STATUS "设置编译类型为:Debug")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -O0 -DDEBUG")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
    message(STATUS "设置编译类型为:Release")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -DNDEBUG")
else()
    message(FATAL_ERROR "不支持此编译类型.")
endif()

#3.
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/log)
file(GLOB srcCore ${CMAKE_SOURCE_DIR}/log/*.cpp)

#4.
add_executable(testLog ${CMAKE_SOURCE_DIR}/test/testLog.cpp ${srcCore})
add_executable(testParseParam ${CMAKE_SOURCE_DIR}/test/testParseParam.cpp ${srcCore})